package Vue;



/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Taupe
 */

import java.awt.Color;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.JPanel;

public class Case extends JPanel{
    
    protected int x;
    protected int y;
    protected int indiceCase = 0;

    public Case() {
        super();
        
        setBackground(Color.white);
        
        addMouseListener(new MouseAdapter() {
        
            @Override
            public void mouseEntered(MouseEvent arg0) {
                super.mouseClicked(arg0);
                setBackground(Color.BLACK);
            }

            @Override
            public void mouseExited(MouseEvent arg0) {
                super.mouseExited(arg0);
                setBackground(Color.red);
            }
            
            
            
        });
        
    }
    public Case(int x, int y, int indice) {
        super();
        this.x = x;
        this.y = y;
        this.indiceCase=indice;
        setBackground(Color.white);
                
 }    public Case(int x, int y) {
        super();
        this.x = x;
        this.y = y;
        this.indiceCase = 0;
        setBackground(Color.white);
                
 }
    
    
 public Case(int indice) {
       super();
       this.indiceCase=indice;
        if (this.indiceCase==0)
        setBackground(Color.white);
        else if (this.indiceCase==1)
        setBackground(Color.yellow);
        else if(this.indiceCase==2)
        setBackground(Color.GRAY);
    }
    
    public int getIndiceCase() {
        return indiceCase;
    }

    public void setX(int x) {
        this.x = x;
    }

    public void setY(int y) {
        this.y = y;
    }

    public void setIndiceCase(int indiceCase) {
        this.indiceCase = indiceCase;
    }
    
    public int getX()
    {
        return this.x;
    }
    
    public int getY()
    {
        return this.y;
    } 
    
   
        
    }
    

